let simpleKoa = require('./application');
let app = new simpleKoa();

let responseData = {};

app.use(async (ctx, next) => {
    console.log(1);
    responseData.name = 'hejiajun';
		await next();
		ctx.body = responseData;
    console.log(1);
});

app.use(async (ctx,next)=>{
  console.log(2);
	responseData.age = 16;
	await next();
  console.log(2);
});

app.use(async (ctx,next)=>{
  console.log(3);
	responseData.sex = 'nan';
  console.log(3);
	// throw new Error('000');
});

app.listen(3000, () => {
    console.log('listening on 3000');
});
